const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
const WxParse = require('../Common/wxParse/wxParse.js');
Page({
  data: {
    key:'',
    title:'',
  },
  onLoad: function (option) {
    if(option.key){ //  一口价购买流程
      this.setData({
        key:option.key,
        title:option.name,
      })
      wx.setNavigationBarTitle({
        title:option.name
      })
      this.appinfo()
    }
    
  },
  onShow(){

  },
  appinfo(){
    Controller.appinfo({key:this.data.key}).then(res=>{
      if(res.data.baseData){
        if(res.data.baseData.content){
          var content=res.data.baseData.content
          var that = this;
          WxParse.wxParse('content', 'html', content, that, 5);
          res.data.baseData.content = JSON.stringify(res.data.baseData.content).replace(/<img/gi, "<img class='richImg' style='width:auto!important;height:auto!important;max-height:100%;width:100%;'");
          res.data.baseData.content = JSON.parse(res.data.baseData.content);
        }
      }
    })
  },
  onShareAppMessage: function( options ){
     
  },
})